import sys

if len(sys.argv) != 2:
	print 'input format error!\npython key_distribution.py load.out'
	sys.exit()

num = 0
key_distribution = {}

f = file(sys.argv[1])
while True:
	line = f.readline()
	if len(line) == 0:	# Zero length indicates EOF
		break	
	items = line.split()
	key_num = items[1].split(":")
	if key_distribution.has_key(key_num[1]) == True:
		key_distribution[key_num[1]] = key_distribution[key_num[1]]+1
	else:
		key_distribution[key_num[1]] = 1
	num = num + 1

f.close()	#close the file

for k, v in key_distribution.items():
    print '%s\t%f' % (k, float(v)/num)
